package org.duiduo.result;

import lombok.*;

/**
 * 返回处理集
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ResultData {
    private String code;
    private String message;

    /**
     * 成功
     *
     * @return
     */
    public static ResultData success() {
        return ResultData.builder()
                .code("00")
                .message("响应成功")
                .build();
    }

    /**
     * 失败
     *
     * @return
     */
    public static ResultData error(String code, String message) {
        return ResultData.builder()
                .code(code)
                .message(message)
                .build();
    }
}
